﻿CMAKE_MINIMUM_REQUIRED(VERSION 3.1)

PROJECT(demo)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
    include_directories(${PROJECT_ROOT}/3rdparty/wolfMQTT)
    add_library(mqtt_test_lib STATIC
        mqttexample.c
        mqttnet.c
        )
    target_link_libraries(mqtt_test_lib wolfmqtt wolfssl)

    function(add_mqtt_example name src)
        add_executable(${name}
            ${src}
            )
        target_link_libraries(${name} wolfmqtt wolfssl mqtt_test_lib)
        INSTALL(TARGETS ${name}  
                ARCHIVE DESTINATION lib
                RUNTIME DESTINATION bin)
    endfunction()


    #add_mqtt_example(mqttclient mqttclient/mqttclient.c)
    #add_mqtt_example(mqttsimple mqttsimple/mqttsimple.c)
    #add_mqtt_example(nbclient nbclient/nbclient.c)
    #add_mqtt_example(mqttuart mqttuart.c)
    add_mqtt_example(multithread multithread/multithread.c)
    #add_mqtt_example(sn-client sn-client/sn-client.c)
    #add_mqtt_example(sn-client_qos-1 sn-client/sn-client_qos-1.c)
    #add_mqtt_example(sn-multithread sn-client/sn-multithread.c)
    #add_mqtt_example(awsiot aws/awsiot.c)
    add_mqtt_example(bwsiot bws/bwsiot.c)
    #add_mqtt_example(wiot wiot/wiot.c)
    #add_mqtt_example(azureiothub azure/azureiothub.c)
    #add_mqtt_example(fwpush firmware/fwpush.c)
    #add_mqtt_example(fwclient firmware/fwclient.c)



